package fnic.jsontrans.modesearch;

import java.util.ArrayList;

public class RangeFacetOutput {
	
	long allcount;
	int itemListsize;
	
	ArrayList<RangeInfo> rangeItemList;
	
	public RangeFacetOutput(){
		rangeItemList =new ArrayList<RangeInfo>();
		allcount = 0;
		itemListsize = 0;
	}
	
	public void addRangeItem(RangeInfo element){
		rangeItemList.add(element);
		allcount+=element.getCount();
		itemListsize++;
	}
	
	public long getAllcount(){
		return allcount;
	}
	
	public ArrayList<RangeInfo> getRangeItemList(){
		return rangeItemList;
	}
	
	public static class RangeInfo {
	    double from;    // Range from requested
	    double to;      // Range to requested
	    long count;   // Doc count
	    double min;     // Min value
	    double max;     // Max value
	    double mean;    // Mean
	    double total;   // Sum of values
	    
	    public RangeInfo(double from, double to, long count, double min, double max, double mean, double total){
	    	this.from = from;
	    	this.to = to;
	    	this.count = count;
	    	this.min = min;
	    	this.max = max;
	    	this.mean = mean;
	    	this.total = total;
	    }
	    
	    public double getFrom(){
	    	return from;
	    }
	    
	    public double getTo(){
	    	return to;
	    }
	    
		public long getCount(){
			return count;
		}
		
		public double getMin(){
			return min;
		}
		
		public double getMax(){
			return max;
		}
		
		public double getMean(){
			return mean;
		}
		
		public double getTotal(){
			return total;
		}
	}

}
